package com.harmonyos.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * TODO
 *
 * @Description
 * @Author lanmo
 * @Date 2023/1/13 16:38
 **/
@TableName(value = "tb_News")
@Data
public class TbNews implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)
    private int id;
    private String url;
    private Date date;
    private String authorName;
    private String thumbnailPicS;
    private String title;
    @TableLogic
    private int deleted;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbNews tbNews = (TbNews) o;
        return Objects.equals(url, tbNews.url) &&
                Objects.equals(date, tbNews.date) &&
                Objects.equals(authorName, tbNews.authorName) &&
                Objects.equals(thumbnailPicS, tbNews.thumbnailPicS) &&
                Objects.equals(title, tbNews.title);
    }

    @Override
    public int hashCode() {
        return Objects.hash(url, date, authorName, thumbnailPicS, title);
    }

    @Override
    public String toString() {
        return "TbFourm{" +
                "id=" + url +
                ", tzid=" + date +
                ", user='" + authorName + '\'' +
                ", text='" + thumbnailPicS + '\'' +
                ", time='" + title +'\'' +
                '}';
    }
}
